package demo1;

public class Animal {
    public String name;
    public int age;


    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){//这里public可以不写，然后Dog类或者Bird类把方法类型改成protected
        System.out.println(this.name + "正在吃饭");
    }


}
